package com.webservice;

import com.domain.InsiderUnit;
import com.domain.Rank;
import com.domain.User;

import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import java.util.List;
//http://39.98.59.6/mmms_test/ws
//http://39.98.59.6/mmms_test/ws/user
@WebService(targetNamespace = "http://39.98.59.6/mmms_test/ws/user")
public interface UserWebservice {

    /**
     * 根据手机号查询用户
     * @param tel
     * @return
     */
    @WebResult(name = "User")
    public User findUserByTel(@WebParam(name = "tel")String tel);


    /**
     * 根据单位查询人员
     * @param insiderUnit
     * @return
     */
    @WebResult(name = "userList")
    public List<User> findAllUserByInsiderUnit(@WebParam(name = "insiderUnit")Integer insiderUnit);

    /**
     * 更新个人信息
     * @param user
     */

    public void updateUser(@WebParam(name = "user") User user);

    /**
     * 新增单位信息
     * @param insiderUnit_name 单位名称
     * @return
     */
    @WebResult(name = "int")
    public int addInsiderUnit(@WebParam(name = "insiderUnit_name")String insiderUnit_name);

    /**
     * 修改单位信息
     * @param insiderUnit_id 单位id
     * @param insiderUnit_name 单位名称
     * @return
     */
    @WebResult(name = "int")
    public int updateInsiderUnit(@WebParam(name = "insiderUnit_id")Integer insiderUnit_id,
                                 @WebParam(name = "insiderUnit_name")String insiderUnit_name);


    /**
     * 根据单位查询所有人员
     * @param insiderUnit_id
     * @return
     */
    @WebResult(name = "userList")
    public List<User> findUserByInsiderUnit(@WebParam(name = "insiderUnit_id")Integer insiderUnit_id);

    /**
     * 删除单位信息
     * @param insiderUnit_id
     * @return
     */
    @WebResult(name = "int")
    public int delInsiderUnit(@WebParam(name = "insiderUnit_id")Integer insiderUnit_id);

    /**
     * 新增方法
     * 查找所有单位
     * @return
     */
    @WebResult(name = "insiderUnitList")
    public List<InsiderUnit> findAllInsiderUnit();



    /**
     * 人员注册
     * @param user
     */
    @WebResult(name = "int")
    public int register(@WebParam(name = "user") User user);


    /**
     * 修改用户角色
     * @param user_id 用户id
     * @param role_id 要修改成的角色id
     */
    public void updateRole(@WebParam(name = "user_id") Integer user_id, @WebParam(name = "role_id") Integer role_id);

    /**
     * 变更用户账号状态
     * @param user_id
     * @param account_state_id
     */
    public void updateAccount_state(@WebParam(name = "user_id") Integer user_id, @WebParam(name = "account_state_id") Integer account_state_id);

    /**
     * 根据id查询用户信息
     * @param user_id
     * @return
     */
    @WebResult(name = "User")
    public User findById(@WebParam(name = "user_id") Integer user_id);

    /**
     * 根据id更改用户权限和部门
     * @param user_id
     * @param department_id
     */
    @WebResult(name = "int")
    public int updateDepartment(@WebParam(name = "user_id")Integer user_id, @WebParam(name = "department_id")Integer department_id);

    /**
     * 根据维修类型查询所有维修师傅信息
     * @return
     */
    @WebResult(name = "userList")
    public List<User> findAllMaintenance_Person(@WebParam(name = "maintenance_type")Integer maintenance_type);

    /**
     * 根据账号状态显示所有账户信息
     * @param account_state_id
     * @return
     */
    @WebResult(name = "userList")
    public List<User> findUserByState(@WebParam(name = "account_state_id") Integer account_state_id);

    /**
     * 删除用户信息
     * @param user_id
     */
    public int delUser(@WebParam(name = "user_id") Integer user_id);

    /**
     * 重置密码
     * 888888
     * @param user_id
     */
    public void resetPwd(@WebParam(name = "user_id") Integer user_id);

    /**
     * 根据部门查询所有人员信息
     * @param department_id
     * @return
     */
    public List<User> findUserByDepartment_id(@WebParam(name = "department_id") Integer department_id);

    /**
     * 根据部门查询审批员
     * @return
     */
    public List<User> findReviewerByDepartment();


    /**
     * 查询除自己外所有的审核员
     * @param user_id 自己的id
     * @return
     */
    @WebResult(name = "userList")
    public List<User> findAllInsider(@WebParam(name = "user_id")Integer user_id);

    /**
     * 判断用户是否存在
     * @param tel
     * @return 0为不存在，其他值为找到的用户的个数
     */
    @WebResult(name = "int")
    public int isUser(@WebParam(name = "tel") String tel);

    /**
     * 判断需要注册审核的用户数量
     * @return
     */
    @WebResult(name = "int")
    public int getAccountReportNum();





}
